<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdmodelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admodels', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('adtype_id')->index()->comment('广告类型ID');
            $table->string('value')->default('参数');
            $table->decimal('override_reward_rate')
                ->default(0)
                ->comment('返利比例(覆盖)');
            $table->char('status', 50)
                ->default(\App\Constant\Enum::STATUS_ENABLED)
                ->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admodels');
    }
}
